\chapter{A Competitive Equilibrium Economy with Technological  Externalities}

\begin{chapabstract}
  In this chapter, we develop a decentralized version of the model in
  Chapter 1 and allow for technological externalities. We analyze the
  efficiency of the competitive equilibrium solution and discuss in
  particular different scenarios whereby externalities can result in
  an inefficient outcome. We show that the decentralized economy with
  externalities leads to under-investment in R\&D, slower
  technological progress, and lower investment and consumption. This
  may provide an opportunity for government action to improve
  private sector outcomes.
\end{chapabstract}

\section{Introduction}
\label{sec:introduction_ch2}

The renewable energy industry has been the recipient of substantial production subsidies at the federal and state level in the past several years. In 2008, President Obama proposed spending \$150 billion over the next 10 years on renewable energy R\&D. The government subsidies on renewables was \$14.67 billion in FY2010, and will be more than \$16 billion in FY2013, up from only \$5 billion in 2005.

The justifications often put forward for subsidizing renewable energy  are environmental externalities and
learning-by-doing from the production of renewable
energy. The environmental issues is not the main concern of this study,
since we believe economic growth and cheap energy are of first-order
importance in addressing the energy transition question. \citet{Bentham2008} also found that for the solar energy industry, the
environmental externality is only about 10\% the size of the
learning-by-doing externality, which indicated that the primary
motivation for solar subsidies depends on assumptions about learning-by-doing, rather than environmental externalities.

In Chapter 1, we have developed a dynamic general equilibrium model
with learning-by-doing effects. The model suggested that, due to the
learning-by-doing in renewable energy production, it is optimal for
the transition from fossil fuels to renewable energy to happen when
the cost of fossil energy is still less than the initial cost of
renewable energy. Nevertheless, since the solution was Pareto optimal
we conclude that learning-by-doing effects do not necessarily lead to
sub-optimal results. Resources may naturally flow to the most
profitable and socially desirable uses without any government
intervention as long as the effects have been correctly incorporated
into the price system. 

In this chapter, we show that the same Pareto optimal solution could be found in a decentralized economy. However, we also show that technological externalities may provide some valid arguments
for government action to improve private sector outcomes.  Many
externalities fall into the category of technological externalities;
that is, the behavior of one firm has an impact on the consumption and
production of others, but the price of the product does not take it
into account. As a result, there are differences between private
returns or costs and the returns or costs to society as a whole. In
this paper, we discuss the externalities associated with R\&D and
learning-by-doing.  

R\&D activities are widely considered to have positive effects beyond
those benefiting the company that funds the research. This is because
the goal of all research is the creation of knowledge, which is
neither exhaustive in use nor perfectly excludable; that is,
individuals or firms that have devoted resources to generate new
knowledge may not be able to prevent others from making use of it. But
private agents will only bear the cost of research to the extent that
they can earn private rewards. As a result, R\&D will be
under-provided by a market system, which will lead to sub-optimal
results.

Meanwhile, knowledge spillovers\footnote{The two terms ``technological
  externalities'' and ``knowledge spillovers'' are used
  interchangeably in the thesis.} may arise not only when technology is
created via R\&D, but also when it derives from learning-by-doing at
production. In the first chapter, we considered learning effects that depended only on the producers' own experience. This is usually referred
to as private learning as opposed to spillover learning, by which
producers can also gain from their competitors' experience. There are
various channels for such spillovers, such as reverse engineering,
inter-firm mobility of workers, or proximity (industry clusters).

\citet{Blasi2007} developed a two-period model to investigate whether
learning effects justify subsidizing electricity generated from
renewable resources. The model clarified the clear distinction between
pure private learning and learning spillovers. They found that for the
case of purely private learning, the regulator should only internalize
the external effects of emissions by introducing an emission tax. With
learning spillovers, however, the regulator should additionally
subsidize production of wind turbines and the entry of wind-turbine
producers. They concluded that the subsidy paid to wind-power
operators is too high if learning is entirely private.

% There are indications that R\&D in the energy sector is low in
% relative terms. In the early 80s, energy companies were investing more
% in R\&D than drug companies. However, a negative trend has been
% observed since. Many studies assume that the optimal size of R\&D in
% the energy sector is 5 to 10 times the current level. Is the energy
% sector under-investing in R\&D? Do technological externalities exist
% and lead this under-investing?  What would be the effects of subsidies
% to R\&D in the energy on macroeconomic growth? The answers to these
% questions are important for several reasons that go beyond the
% standard arguments about under-investment in R\&D in other
% industries. Energy is an essential input to much economic activity and
% as such is viewed as one of the sectors that directly connects to
% national security. In addition, and perhaps more importantly from an
% economic perspective, there is an extensive ongoing policy discussion
% in the United States about innovations in the green economy and their
% potential to act as a new engine of economic growth. With substantial
% resources devoted to production and investment subsidies in the
% renewable sector, it is important to have such policies
% evaluated. This, in turn, requires building models in which there is a
% clear link between innovation in both fossil fuel and renewable
% energy, externalities, and government subsidies.  

Several studies showed that investments in new energy sources are
likely to provide high returns for the society as a whole. Apollo Alliance suggested that a major
investment in alternative energy technologies could add more than 3.5
million new jobs to America's economy, stimulate \$1.4 trillion in new
GDP, and pay for itself within 10 years
\citep{Apollo-Alliance2004}. Also, a 2008 University of
Massachusetts study found that a \$100 billion investment in green
programs would create about two million jobs over two years \citep{Pollin2008}.

Other researchers reach more sober conclusions about the potential
effects of subsidies to renewable energy on economic activity and job
creation. A report by the US Senate Subcommittee on Green Jobs and the New
Economy \citep{Bond2009} argues that over \$100,000 in green job subsidies
are needed to create a job. And they found that the wage rates at many
wind and solar manufacturing facilities are below the national
average. A study on the Spanish experience finds that a \euro 28
billion total subsidy to renewable energy between the years 2000 and
2008 created an estimated 50,200 jobs through wind, mini-hydro and
photovoltaic programs. This alone is a subsidy of over \euro 571,000
per job. In addition, they compared the amount of capital the private
sector employed per worker to the level of government subsidy per
green job and concluded that 2.2 jobs in the private sector have been
destroyed for every green job created \citep{Alvarez2009}.

In this chapter, we study a decentralized economy using the model developed in Chapter 1, and allow for R\&D and learning-by-doing spillovers.  Competitive equilibrium allocations in the presence of technological externalities are compared with a Pareto
optimal solution. The main results we find are:
\begin{enumerate}
\item Knowledge spillovers lead to sub-optimal solutions: lower
investment in R\&D, slower technological progress, and lower
output and consumption.  
\item With knowledge spillovers, the fossil fuel regime of the economy lasts a longer time but with fewer fossil fuels consumed. The economy also experiences higher energy  prices during the transition period\footnote{Strictly speaking,
  the transition would take place at a time point instead of a period
  in the model. Here I refer to some short time periods before and
  after this transition point.}.
\item  R\&D spillovers slow down the economy more than learning-by-doing spillovers. 
\end{enumerate}

In the next section, we describe the model setting in discrete time. Section \ref{sec:comp-equil} studies a competitive market economy and shows its equilibrium allocations are Pareto optimal. Technological externalities are introduced in three different scenarios in Section \ref{sec:externalities}. Section \ref{sec:conclusions_ch2} is the conclusion. 

\section{Social Planner Problem in Discrete Time}
\label{sec:soci-plann-probl}

We use a discrete time model instead of a continuous one to study the
competitive market economy with externalities. Basically, a
discrete-time model considers the changes in the state variables
between the start and the end of a time period without reference to
the processes in between. Since decisions are made and data are
released at discrete intervals, the discrete-time approach offers some
advantages over continuous-time models. For example, the integration
of empirical variables is easier to do in a discrete-time framework,  a discrete time framework is also often better suited to modelling a
decentralized economy with many different, but interacting, decision-makers as we assume in this chapter\footnote{An ode solver is just a discretization of the continuous differential equations}. To start with, we reiterate the model in Chapter 1 in discrete time in this section.% more consistent with realistic policy design 

The fictitious social planner gives equal weights to all
households that have identical tastes, and chooses allocations to
maximize the objective function \eqref{eq:ch2obj}.  The constraints of the problem are: four state equations \eqref{eq:kinc}, \eqref{eq:Sinc}, \eqref{eq:Ninc} and
\eqref{eq:Hinc} with initial conditions $S_0=0$, $N_0=0$, $k_0>0$ and
$H_0=0$, the production function \eqref{eq:ch2prod}, energy input \eqref{eq:Ch2energy}, the cost of renewable energy supply
\eqref{eq:ch2RenewCost}, the extraction cost of fossil fuel
(\ref{eq:ch2MiningCost}), and the resource constraint \eqref{eq:ch2Budget}.\footnote{Since the model is deterministic,
  i.e. there are no stochastic shocks or any uncertainty, the dynamic
  programming cannot benefit the model-solving process much. So
  here I solve the problem directly in sequence form.} The control
variables are $c_t$, $i_t$, $n_t$, $j_t$, $R_t$ and $B_t$, and the state
variables are $k_t$, $S_t$, $N_t$ and $H_t$.

\begin{align}
  \label{eq:ch2obj}
  \max_{c_{t},k_{t+1},S_{t+1},H_{t+1},N_{t+1}}
  &\sum_{t=0}^{\infty}\beta ^{t}\frac{c_{t}^{1-\gamma }}{1-\gamma } \\
  \text{s.t. }&c_{t}+i_{t}+n_{t}+j_{t}+g(S_{t},N_{t})R_{t}+q_{t}B_{t} =    y_t \label{eq:ch2Budget}\\
  &R_{t}+B_{t} = y_t \label{eq:Ch2energy}\\
  &y_{t} = Ak_{t}  \label{eq:ch2prod}\\
  &m_{t} =
  \begin{cases}
    (\Gamma _{1}+H_{t})^{-\alpha } & \text{if}\; H_{t}\leq
    \Gamma_2^{-1/\alpha}-\Gamma _1,  \\
    \Gamma _{2} & \text{otherwise}
  \end{cases} \label{eq:ch2RenewCost}\\
&g(S_t,N_t)=\alpha _{0}+\frac{\alpha _{1}}{\bar{S}-S_t-\alpha _{2}/(\alpha
_{3}+N_t)}  \label{eq:ch2MiningCost} \\
  &k_{t+1} = (1-\delta )k_{t}+i_{t} \label{eq:kinc}\\
  &N_{t+1} = N_{t}+n_{t} \label{eq:Ninc}\\
  &S_{t+1} = S_{t}+Q_{t}R_{t} \label{eq:Sinc}\\
  &H_{t+1} = H_{t}+
  \begin{cases}
    B_{t}^{\psi }j_{t}^{1-\psi } & \text{if}\;H_{t}\leq \Gamma _{2}^{-1/\alpha }-
    \Gamma _{1} \\
    0 & \text{otherwise}
  \end{cases} \label{eq:Hinc}\\
  &\text{Given} \, k_{0}\text{, }H_{0}\text{, }N_{0}\text{, }S_0\text{,
  }\forall t
  \nonumber
\end{align}

The meaning of variables and equations remains the same as the model
in previous chapter, except that the transition functions of the state
variables are changed from ordinary differential equations to
difference equations of order 1.  This chapter uses the same
 calibrated parameter values chosen in Chapter 1, except $\beta$ is adjusted to match its new interpretaiton as a period discount factor. Using
the time discount rate 0.05 in the continuous time model, we have $\beta =
1/(1+0.05) = 0.9524$. The evolution of the economy is very similar,
including the four regimes as discussed in Chapter 1. Please see a detailed
analysis in the Appendix A\ref{app:B}.


\section{Competitive Market Problem}
\label{sec:comp-equil}
In this section, we study a competitive market economy and show its equilibrium allocation is also Pareto optimal. It is based on the first fundamental theorem of Welfare Economics, which states that any competitive equilibrium allocation is Pareto optimal. It provides a formal and very general confirmation of Adam Smith's ``invisible hand'' property of the market.

\subsection{Model Assumption}
\label{sec:model-settings}

The model economy has a representative (equivalently, a $[0,1]$
continuum of each) household (consumer), a final good producer, a
fossil energy producer, and a renewable energy producer. Assume that the household owns all factors of production and all shares in
firms. In each period, the household sells factor services and resource
extraction permits to firms. It also buys goods from final good
producer, consumes some of them, and accumulates the rest as capital for the next
period. Assume the firms own nothing. They simply hire capital, energy
or technology on a rental basis to produce output in each period. They sell
the output, and return all profits made to shareholders, i.e. the  household.

To form a competitive market, we will make the following assumptions. First, we assume universal price quoting of commodities (market completeness) and price taking by all economic agents. Second, all transactions take place in the complete market at date 0, and what is being trade in the market is commitments to receive or to deliver amounts of the physical good at period $t = 0,1,\dotsc$. Finally, after this market has closed, agents simply deliver or receive the quantities of factors and goods they have contracted.

The convention for prices in the market is set in Table \ref{tab:prices}: 
\begin{table}[h]
  \centering
  \begin{tabular}[h]{l l}
    \hline
    \hline
    \textbf{Symbol} & \textbf{Meaning} \\
    \hline
    $p_t$ & the price of a unit of final good output \\
    $r_t$ & the real price of capital\\
    $w_t$ & the real price of the technology in fossil fuel sector\\
    $f_t$ & the
    real price of extraction permits for fossil fuel resources underground\\
    $s_t$ & the real price of the accumulated knowledge in renewable energy sector\\

    $p_t^R$ & the
    real price of energy services from fossil fuel\\
    $p_t^B$ & the real price of energy services from  renewable
    energy\\
    \hline
    \hline
  \end{tabular}
  \caption{The settings for prices in competitive markets}
  \label{tab:prices}
\end{table}
The word``real'' in the table means all the prices are expressed in
units of the final goods price in period $t$.  It is known that if a price
$p$ induces a competitive equilibrium, $\alpha p$ also induces a
competitive equilibrium for any $\alpha > 0$. This allows us to
normalize the prices without loss of generality, and we usually do so
by setting the price of the final good $p_0$ at $t=0$ equal to 1.

\subsubsection{Final Good Producer's Problem}
\label{sec:final-good-producers}
The final good producer rents physical capital $k$ from the household, buys energy $R$ or $B$ from energy firms, produces goods $y$, and sells it to the household. Given the prices $\{(p_{t},r_{t}, p_{t}^{R},p_{t}^{B})\}_{t=0}^{\infty
}$, the problem faced by the representative final good producer is to
choose input demands and output supplies
$\{(k_{t}^d,R_{t}^d,B_{t}^d,y_{t})\}_{t=0}^{\infty }$ that maximize net
discounted profits. The decision problem is
\begin{align}
  \label{eq:finalProd}
 \max\pi^F &= \sum_{t=0}^{\infty }p_{t}\left[
    y_{t}^s-r_{t}k_{t}^{d}-p_{t}^{R}R_t^{d}-p_t^BB_t^d \right] \\
  \text{s.t. }y_{t} &\leq Ak_t \nonumber \\
 y_t &= R_t + B_t.  \nonumber
\end{align}

\subsubsection{Fossil Fuel Producer's Problem}
\label{sec:fossil-fuel-producers}
The fossil fuel producer's problem is complicated by the fact that it
is an inter-temporal decision making process on production. According
to the cost function $g(S,N)$ we assumed, current extraction will
always increase the future costs through the variable $S$. To capture this
inter-temporal effect, we assume there is a market in resource permits. At each time period $t$, the
fossil fuel producer buys an extraction permit for resource underground $\bar{S}-S_t$ from the household, produces energy services $R_t$, and sells the permit for resource left, $\bar{S}-S_{t+1}$, back to the household.  
Meanwhile, the producer also rents technology stock $N_t$ from the household and sells energy
services $R_t$ to the final good producer.

Given the prices $\{(p_{t}, w_t, f_t, p_{t}^{R},p_{t}^{B}
)\}_{t=0}^{\infty}$, the problem faced by the fossil fuel energy
producer is to choose the demand for technology and resource, and the supply of
fossil fuel $\{(N_t^d, S_t^d, S_{t+1},R_t^s)\}_{t=0}^{\infty}$ that maximize net
discounted profits, given initial fossil fuel extraction $S_0$. Thus
the problem can be written as
\begin{align}
  \label{eq:fossilProd}
  \max\pi ^{R} = &\sum_{t=0}^{\infty }p_{t}\left[
    p_{t}^{R}R_{t}^{s}-g(S_{t}^d,N_{t}^d)R_{t}^{s}-w_tN_t^d+f_tS_t-f_tS_{t+1})
  \right] \\
  \text{s.t. } &S_{t+1} = S_{t}+Q_{t}R_{t} \nonumber\\
&Q_{t+1} = (1+\pi)Q_t \nonumber\\
&g(S_{t},N_{t}) =
\alpha_0+\frac{\alpha_1}{\bar{S}-S_t-\frac{\alpha_2}{\alpha_3+N_t}} \nonumber\\
& S_0\text{, } Q_0 \text{ is given}. \nonumber
\end{align}

\subsubsection{Renewable Energy Producer's Problem}
\label{sec:renew-energy-prod}
For the renewable energy producer experiencing technological progress, the production decision made at
time $t$ also affects the future costs due to learning by
doing. We can apply similar techniques as in the fossil fuel producer's
problem. We assume a technology patent market for $H$. In this market, firms buy patents $H_t$ for the production of year $t$ and sell the patents back to the household after it has risen to $H_{t+1}$ thanks to the household's investment $j_t$ and learning-by-doing. 

Given
the prices $\{(p_{t}, s_t, p_{t}^{R},p_{t}^{B}) \}_{t=0}^{\infty}$ and the
initial knowledge level on renewable energy $H_0$, the problem faced
by the renewable energy producer is to choose the demand of the cumulative
knowledge and the energy output supplies $\{(H_{t}^d, B^S_t,
H_{t+1})\}_{t=0}^{\infty}$ that maximize the net discounted profits. The problem can be written as

\begin{align}
  \label{eq:renewProd}
  \max\pi ^{B} &= \sum_{t=0}^{\infty }p_{t}
  \left[ p_{t}^{B}B_{t}^{s}-m_{t}B_t^s-s_tH_t+s_tH_{t+1})\right]  \\
  \text{s.t. } &m_{t} =
  \begin{cases}
    &(\Gamma _{1}+H_{t})^{-\alpha },\quad
    \text{if }H\leq \Gamma _{2}{}^{-1/\alpha}-\Gamma _{1}, \\
   &\Gamma _{2}, \quad  \text{otherwise}
  \end{cases} \nonumber\\
  & H_{t+1} = H_{t}+
  \begin{cases}
    &B_{t}^{\psi }j_{t}^{1-\psi },\quad
    \text{if } H_{t}\leq \Gamma _{2}^{-1/\alpha}-\Gamma _{1}, \\
    &0, \quad \text{otherwise.} \nonumber
  \end{cases} \\
  &H_0 \text{ is given}. \nonumber
\end{align}

\subsubsection{Household's Problem}
\label{sec:households-problem}

Given the full price sequence $\{(p_{t},r_{t}, w_t, s_t, f_t,
p_{t}^{R},p_{t}^{B})\}_{t=0}^{\infty }$, the household must choose
the demand for consumption and investment, and the supplies of the current
capital, \\$
\{(c_t, i_t, n_t, j_t, k_{t+1}, N_{t+1}, S_{t+1}, H_{t+1}, k_t^s,
N_t^s, S_t^s, H_t^s)\}_{t=0}^{\infty}  $,
given initial capital holdings $k_0$, initial technological progress
of fossil fuel $N_0$ and initial state of technical knowledge on
renewable energy $H_0$. Note that the household's supply of
fossil fuel resources is inelastic. It simply sells and buys permits
at the amount that the fossil fuel producer has chosen.  Thus its decision problem is

\begin{align}
  \label{eq:household}
  \max&\sum_{t=0}^{\infty }\beta ^{t}\frac{c_{t}^{1-\gamma }}{1-\gamma } \\
  \text{s.t. }\sum_{t=0}^{\infty }p_{t}\left(
    c_{t}+i_{t}+n_{t}+j_{t}\right)
  &\leq \sum_{t=0}^{\infty }p_{t}\big[
    r_{t}k_{t}+w_tN_t+s_t(H_t-H_{t+1}) \nonumber \\
&+f_t(S_{t+1}-S_t)\big] +\pi +\pi^{R}+\pi ^{B}  \notag \\
k_{t+1} &= (1-\delta )k_{t}+i_{t} \notag \\
  N_{t+1} &=  N_{t}+n_{t} \notag \\
H_{t+1} &= H_{t}+
  \begin{cases}
    B_{t}^{\psi }j_{t}^{1-\psi } &
    \text{if} H_{t}\leq \Gamma _{2}^{-1/\alpha}-\Gamma _{1}, \\
    0 & \text{otherwise.} \nonumber
  \end{cases} \\
  & k_0\text{, } N_0 \text{, and } H_0 \text{ is given.} \nonumber
\end{align}

Constant returns to scale technology imply no profit for the
final good and the two energy firms, that is
\begin{align}
  \label{eq:zeroprofit}
  \pi = \pi^R = \pi^B = 0
\end{align}

\subsection{Definition of Competitive Equilibrium}
\label{sec:find-comp-equil}

A competitive equilibrium is a set of prices $ \{(p_{t},r_{t},w_t, s_t, f_t,  
p_{t}^{R},p_{t}^{B})\}_{t=0}^{\infty}$, an allocation \\ $
\{(c_t, i_t, n_t, j_t, k_{t+1}, N_{t+1}, S_{t+1}, H_{t+1}, k_t^s,
N_t^s, S_t^s, H_t^s)\}_{t=0}^{\infty}  $,
for the representative household, an allocation
$\{(y_{t},k_{t}^{d},R_{t}^{d},B_{t}^{d})\}_{t=0}^{\infty}$ for the representative final
good producer, an allocation $\{(N_t^d, S_t^d, S_{t+1},
R_{t}^{s})\}_{t=0}^{\infty}$ for the representative fossil fuel producer, and an
allocation $\{(H_{t}^d, B_{t}^{s}, H_{t+1})\}_{t=0}^{\infty}$ for the  representative renewable energy
producer, such that, at the stated price,

\begin{enumerate}
\item $\{(y_{t},k_{t}^{d},R_{t}^{d},B_{t}^{d})\}_{t=0}^{\infty }$
  solves problem \eqref{eq:finalProd};
\item $\{(N_t^d, S_t^d, S_{t+1}, R_{t}^{s})\}_{t=0}^{\infty}$ solves problem
  \eqref{eq:fossilProd};
\item $\{(H_t^d, B_{t}^{s}, H_{t+1})\}_{t=0}^{\infty }$ solves problem \eqref{eq:renewProd};
\item $\{(c_t, i_t, n_t, j_t, k_{t+1}, N_{t+1}, S_{t+1}, H_{t+1}, k_t^s,
N_t^s, S_t^s, H_t^s)\}_{t=0}^{\infty}$ solves problem \eqref{eq:household};
\item Markets clear in all periods:
  \begin{enumerate}
  \item $R_{t}^{s} = R_{t}^{d} = R_t$,
  \item $B_{t}^{s} = B_{t}^{d} = B_t$,
  \item $k_{t}^{s} = k_{t}^{d} = k_t$,  
  \item $N_{t}^{s} = N_{t}^{d} = N_t$,
  \item $H_{t}^{s} = H_{t}^{d} = H_t$,
  \item $S_{t}^{s} = S_{t}^{d} = S_t$,
  \item $c_{t}+i_{t}+n_{t}+j_{t}+g_tR_t+m_tB_t = y_{t}$.
  \end{enumerate}
\end{enumerate}

Since the representative household's preferences are strictly
monotonic, the goods prices are strictly positive for each period:
$p_t>0$ for all $t$. 

\subsection{Properties of Competitive Equilibrium}
\label{sec:prop-comp-equil}
To find a competitive equilibrium, we start by listing the first order conditions of the maximization problems of different agents. 
\subsubsection{Final Good Producer's Problem}
\label{sec:final-good-producers-1}
 Because energy services from fossil fuel $R$ and renewable energy $B$ are perfect substitutes for each other, the choice of the energy input solely depends on the energy price. If $p^B > p^R$, fossil fuel is
used; otherwise, renewable energy is used. For the following analysis,
we denote the energy input as $E$ instead of $R$ or $B$ when the energy source is unknown, and the energy price as $p^E$ for simplicity.

Because the price of goods is strictly positive in each period, the
firm will supply the market with all of the output that it produces in each
period. The first constraint of the problem (\ref{eq:finalProd}) holds
with equality, for all $t$. That is,
\begin{align}
  \label{eq:Leotiff_ratio}
  y_t = Ak_t = E_t.
\end{align}
Substituting \eqref{eq:Leotiff_ratio} into the problem
\eqref{eq:finalProd}, we get
\begin{align}
  \label{eq:finalProd_1}
  \max\pi = \sum_{t=0}^{\infty }p_{t}(A-p_t^EA-r_t)k_t.
\end{align}

In this case, the firm has a constant marginal cost. It will supply an
infinite amount when the price is greater than the cost, any positive amount
when the price and the cost are equal, and zero amount when the price is less than
the cost. The competitive equilibrium will be where demand and supply
cross, which is the price-equal-cost case
\begin{align}
  \label{eq:CE_finalProd}
  r_t=(1-p_t^E)A.
\end{align}
Since the capital price $r_t$ cannot be negative, $p_t^E$ has to be
less than $1$.

\subsubsection{Fossil Fuel Energy Producer's Problem}
\label{sec:fossil-fuel-energy}
We now consider the fossil fuel
producer's problem \eqref{eq:fossilProd}. When $p_t^R < p_t^B$, fossil fuel energy is in production, $R_t>0$. The first-order conditions are
\begin{align}
  \label{eq:CE_FOCRs}
 & \partial R_t: p_t^R = g(S_t,N_t) + f_tQ_t \\
  \label{eq:CE_FOCSd}
  &\partial S_{t+1}: \frac{p_t}{p_{t+1}} = \frac{f_{t+1}-\frac{\partial g_{t+1}}{\partial S_{t+1}}R_{t+1}}{f_t} \\
  \label{eq:CE_FOCNd}
  &\partial N_t: w_t = -\frac{\partial g}{\partial N}R_t
\end{align}

  \subsubsection{Renewable Energy Producer's Problem}
  \label{sec:renew-energy-prod-1}
  When $H_{t}\leq \Gamma _{2}^{-1/\alpha }-
    \Gamma _{1}$, the first-order conditions for the representative renewable energy producer are
\begin{align}
  \label{eq:CE_FOCBrenew}
  &\partial B_t: p_t^B = (\Gamma_1+H_t)^{-\alpha}-\psi s_t B_t^{\psi-1}j_t^{1-\psi}\\
  \label{eq:CE_FOCHrenew}
  &\partial H_{t+1}: \frac{p_{t}}{p_{t+1}} = \frac{s_{t+1}-\alpha(\Gamma_1+H_{t+1})^{-\alpha-1}B_{t+1}}{s_t}
\end{align}
Once $H$ reaches the technological frontier, we have $H_{t+1}-H_t = 0$ and $m_t = \Gamma_2$. Therefore, the first-order condition reduces to 
\begin{align}
\label{eq:CE_FOCana}
  p_t^B = \Gamma_2
\end{align}
\subsubsection{Household's problem}
\label{sec:households-problem-1}
Next we move on to the representative household. Because we have consumption $c_t>0$ and capital investment $i_t> 0$ for all $t$, we have first-order conditions that $c_t$ and $k_{t+1}$ must satisfy:
\begin{align}
  \label{eq:CE_FOCc}
&  \partial c_t: \beta^tc_t^{-\gamma}-\lambda p_t = 0\\
  \label{eq:CE_FOCks}
  &\partial k_{t+1}: \frac{p_{t}}{p_{t+1}} = r_{t+1}+1-\delta ,
\end{align}
where $\lambda$ is the multiplier associated with the budget constraint of the problem \eqref{eq:household}. Taking the ratio of equation (\ref{eq:CE_FOCc}) at $t$ and $t+1$, we have an equation for the inter-temporal price ratio:
\begin{align}
  \label{eq:CE_c_PR}
\frac{c_t^{-\gamma}}{\beta c_{t+1}^{-\gamma}} =  \frac{p_{t}} {p_{t+1}}.
\end{align}
When $n_t>0$, a first order condition with respect to $N_{t+1}$ is available:
\begin{align}
\label{eq:CE_FOCNs}
 \partial N_{t+1}: \frac{p_{t}}{p_{t+1}} = w_{t+1}+1.
\end{align}
When renewable energy is in use and $j_t>0$, we have a first order condition with respect to $j_t$:
\begin{align}
\label{eq:CE_FOCj}
\partial j_t: p_t(1-\psi)s_tB_t^{\psi} j_t^{-\psi} - p_t = 0.
\end{align}
From equation (\ref{eq:CE_FOCj}), we could deduce the patent price of knowledge on renewable energy:
\begin{align}
  \label{eq:CE_j_s}
s_t = \frac{j^\psi_t}{(1-\psi)B^\psi_t}.
\end{align}

\subsection{The Evolution of the Economy }
\label{sec:evolution-economy}

In this section, we argue that the economy will evolve through various regimes of energy use and energy technology investment. By setting the parameters, we assume initially all energy services are provided by the lower cost fossil fuels.

\subsubsection{Fossil Fuel Regime: $p^R < p^B$, $E = R$}
In this regime, the renewable energy producer is uncompetitive and out of the economy, $B_t = 0$. Also, the technological investment $n >0$ due to strictly positive marginal products. Therefore, problem (\ref{eq:finalProd}), (\ref{eq:fossilProd}) and (\ref{eq:household}) are solved simultaneously with the market clearing constraints. For the prices and quantities to constitute a competitive equilibrium that must satisfy the first order conditions (\ref{eq:CE_finalProd}) - (\ref{eq:CE_FOCSd}) and (\ref{eq:CE_FOCc}) - (\ref{eq:CE_FOCNs}).

Substituting (\ref{eq:CE_FOCRs})into (\ref{eq:CE_finalProd}), we have a formula of capital price $r_t$
\begin{align}
  \label{eq:CE_rFossil}
  r_t = [1-g(S_t,N_t)-f_tQ_t]A.
\end{align}
Substituting factor prices (\ref{eq:CE_rFossil}) and (\ref{eq:CE_FOCNd}) into equation (\ref{eq:CE_FOCks}) and (\ref{eq:CE_FOCNs}), and combining the result with (\ref{eq:CE_c_PR}), we obtain the two Euler equations:
\begin{align}
\label{eq:CE_Euler1}
\frac{c_t^{-\gamma}}{\beta c_{t+1}^{-\gamma}} &=  (1-g_{t+1}+f_{t+1}Q_{t+1})A+1-\delta  \\
\label{eq:CE_Euler2}
\frac{c_t^{-\gamma}}{\beta c_{t+1}^{-\gamma}} &= 1-\frac{\partial g_{t+1}}{\partial N_{t+1}}Ak_{t+1}.
\end{align}

The dynamic system of this regime is defined by the state equations (\ref{eq:kinc}), (\ref{eq:Ninc}), (\ref{eq:Sinc}), (\ref{eq:CE_FOCSd}), the Euler equations (\ref{eq:CE_Euler1}), (\ref{eq:CE_Euler2}) and the budget constraint
\begin{align}
  \label{eq:CE_rc_fossil}
c_t + i_t + n_t + g(S_t,N_t)R_t = y_t.
\end{align}
Comparing with the aligned regime in the social planner problem in
Appendix A\ref{app:B}, we deduce that the price of the permit to extract fossil fuel $f_t$ is equal to the real shadow price of fossil fuel energy. 
\begin{align}
  \label{eq:CE_PO_f}
f_t = -\sigma_t/\lambda_t.
\end{align} 
Given equation (\ref{eq:CE_PO_f}), we can see that the difference
equation system that describe the competitive equilibrium is exactly  the same as the one that solves social planner problem. Hence it would give us Pareto optimal solutions.

Denote the transition date from fossil fuel to renewable energy as $T_1$. At $T_1$, fossil fuel is no longer used.  Hence we have $f_t = 0$. Also, investment on fossil fuel technology  ceases and $w_t = 0$. There might be a period right before $T_1$ in which $n=0$. During this period, $N_{t+1} =  N_t$, the first order condition (\ref{eq:CE_FOCNd}) and (\ref{eq:CE_FOCNs}) no longer hold and equation (\ref{eq:CE_Euler2}) cannot be used. Instead, this regime could be defined by (\ref{eq:kinc}), (\ref{eq:Ninc}), (\ref{eq:Sinc}), (\ref{eq:CE_FOCSd}), (\ref{eq:CE_Euler1}) and the budget constraint (\ref{eq:CE_rc_fossil}) with $n=0$. Again, we obtain the same equations as apply  in the social planner problem (See Appendix A\ref{app:B}).

At transition point $T_1$, we have $p^R = p^B$, $f_{T_1} = 0$ and $H_{T_1} = 0$. Substituting (\ref{eq:CE_FOCRs}) and (\ref{eq:CE_FOCBrenew}) into this price equality, we have an equation that is only true at $T_1$:
\begin{align}
  \label{eq:pR_pB}
g_t(S_t,N_t)=\Gamma_1^{-\alpha}+\psi s_t B_t^{\psi-1}j_t^{1-\psi}.
\end{align}
Once $g_t$ grows large enough and meets the condition of transition (\ref{eq:pR_pB}), fossil fuels will no longer be used and the economy will be powered by renewable energy from that point onward.   


\subsubsection{Renewable Regime: $p^R>p^B$, $E=B$}
Renewable energy is in use when $p_t^R > p_t^B$, while fossil fuel energy is obsolete due to its high cost. Hence we have $E = B$. In this regime, the renewable energy producer is in production and the R\&D investment $j >0$ due to strictly positive marginal products. Therefore, problem (\ref{eq:finalProd}), (\ref{eq:renewProd}), and (\ref{eq:household}) are solved simultaneously with the market clearing constraints. For the prices and quantities to constitute a competitive equilibrium, they  must satisfy first order conditions (\ref{eq:CE_finalProd}), (\ref{eq:CE_FOCBrenew}) - (\ref{eq:CE_FOCHrenew}), (\ref{eq:CE_FOCc}) - (\ref{eq:CE_c_PR}), and~(\ref{eq:CE_FOCj}).

First, we can  deduce a relationship between the physical capital price $r_t$ and the energy price $p^B_t$ from equation \eqref{eq:CE_finalProd}
and (\ref{eq:CE_FOCBrenew}):
\begin{align}
  \label{eq:CE_rRenew}
r_t = (1-p_t^B)A=\left(1-(\Gamma_1+H_t)^{-\alpha}+\psi s_tB_t^{\psi-1}j_t^{1-\psi}\right)A.
\end{align}

Substituting (\ref{eq:Leotiff_ratio}) and (\ref{eq:CE_j_s}) into \eqref{eq:CE_rRenew}, and then to (\ref{eq:CE_FOCks}), we would have:
\begin{align}
  \label{eq:CE_eq1_Renew}
  \frac{c_t^{-\gamma}} {\beta c_{t+1}^{-\gamma}} &=
  A-(\Gamma_1+H_{t+1})^{-\alpha}A + 1-\delta+
  \frac{\psi j_{t+1}}{(1-\psi)k_{t+1}} .
\end{align}
At the same time, (\ref{eq:Leotiff_ratio}), (\ref{eq:CE_FOCHrenew}) and (\ref{eq:CE_j_s}) give us another equation needed to solve the system,
\begin{align}
    \label{eq:CE_eq2_Renew}
  \frac{c^{-\gamma}}{\beta c_{t+1}^{-\gamma}} &=
  A^{\psi}k^{\psi}j^{-\psi} \left[
    (1-\psi)\alpha Ak_{t+1}(\Gamma_1+H_{t+1})^{-\alpha-1} +
    A^{-\psi}k_{t+1}^{-\psi}j_{t+1}^{\psi}
  \right].
\end{align}
The dynamic evolution of this renewable regime could be fully described by a difference equation system with the state equations (\ref{eq:kinc}), (\ref{eq:Hinc}), (\ref{eq:CE_FOCHrenew}), the Euler equations (\ref{eq:CE_eq1_Renew}), (\ref{eq:CE_eq2_Renew}), and the budget constraint 
\begin{align}
  \label{eq:CE_bc_renew}
c_t + i_t + j_t + m_tB_t = y_t.
\end{align}
Obviously, equation (\ref{eq:CE_eq1_Renew}) and
(\ref{eq:CE_eq2_Renew}) are the same as equations
(\ref{eq:EulerkRenew}) and (\ref{eq:EulerHRenew}) in the social planner
problem (as shown in Appendix A\ref{app:B}), respectively. Then we again obtain the same equation system as that of the social planner problem. Hence the competitive equilibrium solutions are Pareto optimal as well.

Note that the patent price of the cumulative knowledge $s_t$ is equal to the real shadow price of $H_t$ in the social planner problem: 

\begin{align}
  \label{eq:CE_s_eta}
s_t = \frac{\eta_t}{\lambda_t} = \frac{j^\psi_t}{(1-\psi)B^\psi_t}.
\end{align}
Before renewable technology reaches its technological frontier $ \Gamma _{2}^{-1/\alpha}-\Gamma _{1}$, due to the strictly positive marginal product of $H_t$, $s_t$ is always positive.  Therefore, from equation (\ref{eq:CE_s_eta}) above, we know R\&D investment $j$ would keep positive until technological frontier is reached. 

Once  technological progress in the renewable sector reaches its upper
limit, the production cost $m_t$ equals  a constant
$\Gamma_2$. $H_t$ no longer exists in the firm and household's
problems. In this case, equation (\ref{eq:CE_finalProd}),
(\ref{eq:CE_FOCks}), and (\ref{eq:CE_FOCana}) apply. Combining with the
first order condition (\ref{eq:CE_c_PR}), we have the equation
\begin{align}
  \label{CE_analytical}
\frac{c_t^{-\gamma}}{\beta c_{t+1}^{-\gamma}} = (1-\Gamma_2)A+1-\delta = \bar{A}.
\end{align}
Equation (\ref{CE_analytical}) above, the state equation (\ref{eq:kinc}) and the budget constraint 
\begin{align}
  \label{eq:CE_bc_ana}
c_t+i_t+\Gamma_2B_t = y_t
\end{align}
together define the long-run regime without any technological progress. Solving the difference equation system analytically, we have the limiting policy function of state variable $k_t$
\begin{align}
  \label{eq:CE_k_ana}
k_{t+1} = (\beta\bar{A})^{1/\gamma}k_t.
\end{align}
And the long-run economic growth rate will be $(\beta\bar{A})^{1/\gamma}-1$.

\subsection{Numerical Solutions of Competitive Equilibrium}
\label{sec:results}

Following the calibration in section \ref{sec:calibration}, in this section, we will solve the competitive market model numerically.\footnote{Comparing to the initial target value $k(0)=3.6071, N(0)=0=S(0), n(0)=0.0083$ and $c(0)=0.6620$, the closest calculated initial values of $k0 = 3.6070, N0 = 9.2457e-05, S0 = 20.4151, n(0)=0.0066$ and $c(0)=0.6189$.} The transition to the renewable energy regime occurs after $T_{1} = 98$ years. Following that, renewable energy is used for 268 years (until $T_2=366$) before $H$ attains its maximum value and direct R\&D expenditure $j$ is no longer worthwhile. Output per capita grows at an average annual rate of 2.94\% in the fossil regime, 2.92\% per annum (p.a.) in the renewable regime with R\&D investment, and 3.67\% p.a. in the long-run with renewable energy at its minimum cost.\footnote{ In the long run, per capita consumption, investment, and energy use all grow at the same average annual rate of 3.67\%, calculated by equation (\ref{eq:CE_k_ana}).}

\begin{figure}[h]
\centering \includegraphics[width=6in]{ch2/full_PO.pdf}
\caption[Pareto optimal results, all regimes]{Pareto optimal results: (a)$k$, (b)$c$, (c)$i$, (d)$p$, $[0, T_2]$}
\label{fig:fullPO}
\end{figure}


\begin{figure}[h]
\centering \includegraphics[width=6in]{ch2/full_logPO.pdf}
\caption[Pareto optimal results in semilog form, all regimes]{(a)$k$, (b)$c$, (c)$i$, (d)$p$ in semilog form, $[0, T_2]$}
\label{fig:fulllogPO}
\end{figure}

\begin{figure}[h]
\centering \includegraphics[width=6in]{ch2/full_pricePO.pdf}
\caption[Energy price and shares of output, all regimes]{Energy price and shares of output, (a)$p^R$, (b) $\frac{c}{y}$, (c) $\frac{i}{y}$, (d)$\frac{i+n+j}{y}$, $[0, T_2]$}
\label{fig:full_pricePO}
\end{figure}

\begin{figure}[h]
\centering \includegraphics[width=6in]{ch2/fossil2PO.pdf}
\caption[Pareto optimal results, fossil fuel regime]{Pareto optimal results:(a)$S$, (b)$N$, (c)$g$, (d)$n$, fossil fuel regime}
\label{fig:fossil2PO}
\end{figure}

\begin{figure}[h]
\centering \includegraphics[width=6in]{ch2/renew2PO.pdf}
\caption[Pareto optimal results, renewable energy regime]{Pareto optimal results: (a)$m$, (b)$j$, renewable energy regime}
\label{fig:renew2PO}
\end{figure}

Figure~\ref{fig:fullPO} shows the behavior of the main variables in the economy for 366 years before entering the final analytical regime. From Figure \ref{fig:fullPO}(a) - (c), we could see capital $k$, investment $i$ and consumption $c$ rise quickly and span 5 orders of magnitude. Figure \ref{fig:fullPO}(d) shows the real price of the good decreases as consumption $c$ grows. Variables in Figure (\ref{fig:fullPO}) are also shown in the semi-log plot in Figure \ref{fig:fulllogPO} so that changes for small values could be captured. In Figure \ref{fig:fulllogPO}, we can see some interesting changes during the transition period: The investment growth slows down  and then has a spike (~\ref{fig:fulllogPO}(a)). Capital growth follows the same trend as investment growth in a mild way(~\ref{fig:fulllogPO}(b)). On the other hand, the consumption growth rate slows down (~\ref{fig:fulllogPO}(c)) and the goods price decreases slower as well (~\ref{fig:fulllogPO}(d)). This is mainly because investment in fossil fuel technology $n$ increases sharply during this period and constrains $i$ and $c$. Also, the high energy price keeps the good price from decreasing. 

Figure \ref{fig:full_pricePO} shows the energy price and shares of output. In \ref{fig:full_pricePO}(a), we observe that the energy price starts low and keeps flat for some decades, then it increases mainly due to the growing price of the extraction permit $f_t$ and population growth $Q_t$ . It peaks at year 94 with a price that is nearly 6 times the starting value and then drops because the permit price decreases to zero. At the transition time $T_1 = 98$, the price is the extraction cost $g_{T_{1}}$, which is  around 4 times the starting price. The energy price keeps decreasing in the renewable regime. At $T_2$, the energy price is $\Gamma_2$, which is slightly lower than the starting price by calibration. Figure \ref{fig:full_pricePO}(b)-(c) are the consumption share and the investment share of the output, respectively. We see that the consumption share falls down during the transition while the investment share peaks. 

We then turn to the fossil fuel regime to study the transition of variables when $T_1$ is approaching. In Figure \ref{fig:fossil2PO}, (a) is the cumulative production of fossil fuel. At the transition date, about 75\% of the fossil fuel resource underground has been extracted. (d) shows the investment in fossil fuel technologies. It remains low for about 50 years. Then due to resource depletion, the marginal production cost tends to rise as long as the difficulty of extraction increases. In order to maintain the cost at a reasonable level, $n$ rises very fast until close to the transition. The period  $n=0$ is very short, lasting only 0.05 year\footnote{Because $n=0$ period is shorter than a year, in order to investigate the dynamics of n, I solve a corresponding differential equation system in $[T_1-1, T_1]$}. Once the investment $n$ ceases, the mining cost rises dramatically (~\ref{fig:fossil2PO}(c)) and the transition to renewables follows soon thereafter. 
% \begin{figure}[h]
% \centering \includegraphics[width=7in]{ch2/fossil1PO.png}
% \caption{results}
% \label{fig:fulllogPO}
% \end{figure}

In the renewable energy regime, the marginal production cost $m$ and the R\&D investment $j$ are shown in Figure \ref{fig:renew2PO}. A brief initial burst of investment in the renewable R\&D right after the transition steeply cuts the energy production cost. Then R\&D investment in renewable energy  drops close to zero. It subsequently gradually increases over time before plunging toward zero again as the technological frontier for renewable energy efficiency is approached. Evidently, for much of the ``middle period'' of this regime, learning-by-doing is a major source of the accumulation of technical knowledge.

% Figure~\ref{fig:GrowthRates} shows the annual growth rates of per capita output and consumption. As we would expect given concave utility, consumption growth is somewhat smoother than output growth, but the fluctuations in consumption growth are substantial. Per capita consumption grows by an average 3.68\% in the fossil energy regime, which is less than the average output growth. By contrast, in the renewable regime with R\&D, although R\&D investment takes resources away from consumption and investment in $k$, the declining cost of energy allows consumption to grow at 3.33\% compared to average annual growth in output of 3.11\%.

\clearpage
\section{Technological Externalities}
\label{sec:externalities}
In this section, we will study  technological externalities, 
which imply the welfare theorems will not hold. An externality is present
whenever the well-being of a consumer or the production possibilities
of a firm are directly affected by the actions of another agent in the
economy and those effects are not reflected in market prices
 \citep{Mas-Colell1995}. By assumption the households do not
incorporate the utility associated with it into their consumption,
saving, and production decision. As a result, there are differences
between private returns or costs and the returns or costs to the
society as a whole, and the competitive equilibrium allocation is no
longer efficient.

In contrast with the standard competitive model, we assume that
technological progress in renewable energy has knowledge
spillovers. Also, knowledge spillovers may arise not only when
technology is created via R\&D investment, but also when it derives
from learning by doing at production. Let $\bar{B}_{t}$ and $\bar{j}_{t}$
stand for the aggregate levels of $B$ and $j$, respectively. That is,
we assume each renewable energy producer's knowledge accumulation not
only comes from its own R\&D investment and experience at production,
but also from the aggregate actions taken by all producers.  The
knowledge accumulation as a function of the renewable technology changes to:
\begin{align}
  H_{t+1}=H_{t}+
  \begin{cases}
    (\bar{B}_{t}^{\theta}\bar{j}_{t}^{\rho})B_{t}^{\psi-\theta }j_{t}^{1-\psi-\rho } & \text{ if $
      H_{t}\leq \Gamma _{2}^{-1/\alpha }-$}\Gamma _{1}, \\
    0 & \text{otherwise.}
  \end{cases}
\label{eq:Hinc_ex}
\end{align}
where $\theta$ is the spillover weight of learning-by-doing, and
$\rho$ measures the extent of R\&D externalities. With $\theta = \rho = 0$, The function is the same as the case with no externality. With $\theta = \psi$ and $\rho = 1-\psi$, there are 100\% learning and R\&D 
spillovers, and the knowledge accumulation only depend on the cumulative production of all producers and the aggregate level of R\&D in the
industry. Using equation (\ref{eq:Hinc_ex}) instead of
(\ref{eq:Hinc}), the Euler
equations of the renewable regime \eqref{eq:CE_eq1_Renew} and
\eqref{eq:CE_eq2_Renew} change to
\begin{align}
  \label{eq:CE_eq1_Renew_ex}
  \frac{c_t^{-\gamma}} {\beta c_{t+1}^{-\gamma}} &=
  A-(\Gamma_1+H_{t+1})^{-\alpha}A + 1-\delta+
  \frac{(\psi-\theta) j_{t+1}}{(1-\psi-\rho)k_{t+1}} \\
  \label{eq:CE_eq2_Renew_ex}
  \frac{c^{-\gamma}}{\beta c_{t+1}^{-\gamma}} &=
  A^{\psi}k^{\psi}j^{-\psi} \left[
    (1-\psi-\rho)\alpha Ak_{t+1}(\Gamma_1+H_{t+1})^{-\alpha-1} +
    A^{-\psi}k_{t+1}^{-\psi}j_{t+1}^{\psi}
  \right]
\end{align}

We study three different scenarios: $\rho = 0.05\psi, \theta = 0.95\psi$, $\rho = 0.25\psi, \theta = 0.75\psi$; and $\rho = 0.95\psi, \theta = 0.05\psi$. In the first scenario, we have small R\&D spillovers and large learning-by-doing spillovers. In the second scenario, R\&D spillovers increase a little but are still not comparable to learning spillovers. We expect the effects of the learning spillover to be larger, so we assume a larger $\theta$ in the first two scenarios. The last scenario is a contrasting case with large R\&D externalities and small learning spillovers. Results are reported in detail in the next section. 
\clearpage
\section{Knowledge Spillover Scenarios}
\label{sec:spillover-scenarios}
In this section, we compare the three externality scenarios with the  Pareto optimal solution in section \ref{sec:results}. As shown in Table \ref{tab:4cases}, we denote the four scenarios including Pareto optimal one as case A, B, C, and D, respectively. % Table \ref{tab:4cases} shows us some trends: as $\rho$ goes up and $\psi$ goes down,   

\begin{figure}[h]
\centering \includegraphics[width=6in]{ch2/fossil1.pdf}
\caption[Scenario comparison part 1, fossil fuel regime]{Scenarios:(a)k, (b)c, (c)i, (d)n, fossil fuel regime}
\label{fig:fossil1}
\end{figure}

\begin{table}
  \begin{tabular}[h!]{c c c c c}
    \hline
    \hline
Case & A & B & C & D \\
    & $\rho = 0$, & $\rho = 0.05\psi$, & $\rho = 0.25\psi$, & $\rho = 0.95\psi$,  \\
Variables & $\theta = 0$ &  $\theta = 0.95\psi$  & $\theta = 0.75\psi$ & $\theta = 0.95\psi$ \\
\hline
$T_2$ & 366 & 387 & 400 & 436\\
$T_1$ & 98 & 103 & 106 & 112 \\
$S_{T_1}$ & 1595 & 1582 & 1579 & 1570\\
\hline
\hline 
 \end{tabular}
  \centering
  \caption{Transition dates and extracted fossil fuel resources at $T_1$}
  \label{tab:4cases}
\end{table}


\begin{figure}[h]
\centering \includegraphics[width=6in]{ch2/fossil2.pdf}
\caption[Scenario comparison part 2, fossil fuel regime]{Scenarios: (a)$S$, (b)$f$, (c)$g$ (d)$p^R$, fossil fuel regime}
\label{fig:fossil2}
\end{figure}

\begin{figure}[h]
  \centering \includegraphics[width=6in]{ch2/renew1.pdf}
\caption[Scenario comparison part 1, renewable energy regime]{Scenarios: (a)$k$, (b)$c$, (c)$i$, (d)$j$, renewable energy regime}
\label{fig:renew1}
\end{figure}

\begin{figure}[b]
  \centering \includegraphics[width=6in]{ch2/renew2.pdf}
\caption[Scenario comparison part 2, renewable energy regime]{Scenarios: (a)$p$, (b)$P^B$, (c)$H$, (d)$m-p^B$, renewable energy regime} 
\label{fig:renew2}
\end{figure}

Figure \ref{fig:fossil1} and \ref{fig:fossil2} show some of the main variables of all four scenarios in the fossil fuel regime. Both figures and  Table \ref{tab:4cases} show that in case A, the economy transits to the renewable regime earliest, while it takes longer for cases B, C, and D to reach the transition. We find that the four scenarios are similar in  the first 50 years or so and then diverge.  In Figure \ref{fig:fossil1}, the black line (case A) lies above all three cases B, C and D  and shows the highest $k$, $c$, $i$, and $n$. Unlike the Pareto optimal case A, in cases B, C, and D, consumptions decline substantially in the later fossil fuel period (\ref{fig:fossil1}(b)). Investments also suffer some decrease and slow the accumulation of capital before technological investment $n$ ceases(\ref{fig:fossil1}(a) and (c)). 

Case A exploits the most fossil fuel resources at the transition date, while case D exploits the least, even through it remains in the  fossil regime for the longest time. This is because we assume $E =  Ak$ all the time without any energy efficiency improvement. Hence higher output and consumption require higher energy input. 

Figure \ref{fig:fossil2}(c) is the marginal extraction cost $g$, which stays almost constant during most of the fossil fuel regime and then rises dramatically when investment in mining technology stops. The pattern of the four cases is comparable to Figure~\ref{fig:g_function_seq} in Chapter 1, and again shows the ``moving parity target'' feature of the model. \ref{fig:fossil2}(b) is the extraction permit price $f_t$. It rises as long as the resource is depleting and becomes more expensive. It drops to zero at $T_1$ when fossil fuel extraction becomes uneconomic. Summing up the production cost and the total price of extraction permits, we can get the fossil fuel price shown in \ref{fig:fossil2}(d). We find that the prices are higher in cases with externalities, and case D with the heavy R\&D spillovers suffers the highest prices.

% Generally, C is the best scenario while D is the worst.  Please see
% the results below and pics in the attachment.  1. D will reach
% technology frontier later. Tbar: C < A < B < D 2. Price ratio
% p_t+1/p_t : C < A < B < D 3. Energy price: C < A < B < D 4. The long
% run growth rate: 3.67%
% 5. D will transit to renewable energy economy later: T0: C < A < B <
% D 6. C consumes most fossil fuel energy S_T0: C > A > B > D
% 7. Extraction cost g of D is the highest. g: C < A < B < D

Figure \ref{fig:renew1} and \ref{fig:renew2} show the main variables
in the renewable regime. Note that the origin of the coordinates on
$x$ axis is the transition point $T_1$ instead of $T = 0$. First of
all, we see economies with
externalities reach the technological frontier later (Also see
Table \ref{tab:4cases}). The reason is that sub-optimal investments (~\ref{fig:renew1}(c) and (d)) slow down the technological progress.
%
% \begin{figure}[h]
%   \centering \includegraphics[width=6in]{ch2/full_detail.pdf}
%   \caption{close-up look around transition point $[T_1-20, T_1+20]$}
%   \label{fig:full_detail}
% \end{figure}      
% 

In Figure \ref{fig:renew2}, we observe that case A has the lowest goods price and energy price (\ref{fig:renew2}(a) and (b)). Cumulative knowledge $H$ reaches to its upper limit sooner because of higher investment(~\ref{fig:renew2}(c)). Figure \ref{fig:renew2}(d) shows the learning-by-doing contribution to energy prices. At the transition point, case A has the highest learning-by-doing effect and the lowest initial renewable energy price. That's why case A transits sooner than the other three cases. 

According to comparisons across these four cases above, R\&D spillovers (case D) appear to lead to the most severe under-investment problem and retard the economy the most. It is probably because in this case, the household has a very low motivation to invest in R\&D and looks forward to taking benefits from other firms as a  ``free-rider''. 

% We took a close-up observation around the transition periods and reported it in \ref{fig:full_detail}.


% \begin{figure}[t]
%   \centering \includegraphics[width=6in]{ch2/full_log.pdf}
% \caption{(a)k, (b)c, (c)i, (d)p in semilog form, $[0, T_2]$}
% \label{fig:full_log}
% \end{figure}

% \begin{figure}[h]
%   \centering \includegraphics[width=6in]{ch2/full_P.pdf}
% \caption{Energy price}
% \label{fig:full_P}
% \end{figure}

% When $\theta = 0.95\psi$, every unit investment of $k$ has a positive externality. Normally, public goods are 
% the case $\rho = 0.5\psi$ and $\theta = 0.5\psi$, due to lower investment in R\&D, economy takes longer to
% reach the technological frontier (about 10 years). Fossil fuel regime ends 2 years early with less fossil fuel
% consumed. Goods price is higher all along the time, while lower fossil
% fuel price and higher renewable price have been detected.


 % In the previous section, we
% show the case where the connection between competitive
% equilibria and Pareto optima breaks down, as it does in the presence
% of technology spillover or other externality distortions, and I will figure out how policy helps in this section.

% In this section, I use the model to evaluate different policy scenarios regarding
% imposing taxes on the use of fossil fuel and offering government subsidies
% (financed by taxation) on the use and development of renewable energy.

% Taxing fossil fuels accelerates the rate of adoption of the renewable
% energy technology.  However, a main finding of our analysis is that
% the elasticity of the adoption rate appears to be small. In our model
% economy, a tax as high as $%
% 20\%$ accelerates the renewable technology adoption by about eleven
% years, while a more realistic $2\%$ tax accelerates the transition by
% only five years. 

% Subsidies on renewable
% energy investment also accelerate the rate of adoption of the
% renewable energy technology. Indeed, a renewable energy subsidy
% appears to be more effective than a tax on fossil fuels, with a $2\%$
% subsidy accelerating the introduction of the renewable energy regime
% by nineteen years. However, the renewable energy subsidy also leads to
% a more intensive use of fossil fuel reserves in the short run. This
% somewhat paradoxical conclusion could be important for policy
% makers. It can be explained as follows. Since the abandonment of
% fossil fuel is accelerated as a result of the subsidy, the opportunity
% cost of using fossil fuel in the short run declines. Thus, while the
% subsidy on renewables leads to a faster transition away from fossil
% fuels, it also implies a more intensive short run use of fossil fuel
% than what is socially optimal. This could imply an increase in
% emissions associated with fossil fuel combustion in the short run.
\clearpage
\section{Conclusion}
\label{sec:conclusions_ch2}

Although both the social planner solution and the competitive
equilibrium solution gave similar evolution trends of the economy, the
substantially different allocations between the two highlight the
important role played by the technological externalities in economic
growth.

In this chapter, we have developed a decentralized version of the
model in Chapter 1. This decentralized model allows for technological
externalities. We have analyzed the efficiency of the competitive
equilibrium solution and discussed in particular different scenarios
in which externalities can result in an inefficient outcome. We have
showen that the decentralized economy with externalities will lead to
under-investment in R\&D, slower technological progress, and lower
investment and consumption. This may potentially allow the government
to take better actions to improve the private sector outcomes.
  


% \begin{align}
%   \label{eq:ValueFunRenew}
%   V(k,H) &= \max_{i,j}\left\{
%     \frac{c^{1-\gamma}}{1-\gamma}+\beta V(k^{\prime }, H^{\prime })
%   \right\} \\
%   \label{eq:kincRenew}
%   \text{s.t. } k^{\prime} &= i+(1-\delta)k \\
%   \label{eq:HincRenew}
%   H^{\prime } &= H+B^{\psi }j^{1-\psi }  \\
%   \label{eq:RConRenew}
%   Ak &= c+i+j+(\Gamma_1+H)^{-\alpha}Ak
% \end{align}

% The first order conditions for a maximum with respect to the control
% variables are as below, and I abbreviate $V(k^{\prime }, H^{\prime })$
% as $V^{\prime}$ afterwards.

% \begin{align}
%   \label{eq:FOCiRenew}
%   \frac{\partial V}{\partial i} &=
%   -c^{-\gamma} +
%   \beta\frac{\partial V^{\prime}}{\partial k^{\prime}} = 0\\
%   \label{eq:FOCjRenew}
%   \frac{\partial V}{\partial j} &=
%   -c^{-\gamma} + \beta\frac{\partial V^{\prime}}{\partial H^{\prime}}
%   (1-\psi)A^{\psi}k^{\psi}j^{-\psi} = 0
% \end{align}


% Substituting from \eqref{eq:kincRenew} and \eqref{eq:HincRenew} to
% eliminate $i$ and $j$ in \eqref{eq:RConRenew}, and then
% \eqref{eq:RConRenew} into \eqref{eq:ValueFunRenew} to eliminate $c$,
% I can write the planner problem as a function of $k$ and $H$. Then we
% apply the Benveniste-Scheinkman formula to it, which gives us:
% \begin{align}
%   \label{eq:ETkRenew}
%   \frac{\partial V}{\partial k} &=
%   c^{-\gamma}(A-(\Gamma_1+H)^{-\alpha}A) +
%   \beta\frac{\partial V^{\prime}}{\partial k^{\prime}}(1-\delta)+
%   \beta\frac{\partial V^{\prime}}{\partial H^{\prime}}
%   \psi A^{\psi}k^{\psi-1}j^{1-\psi} \\
%   \label{eq:ETHRenew}
%   \frac{\partial V}{\partial H} &=
%   c^{-\gamma}(\alpha Ak(\Gamma_1+H)^{-\alpha-1}) +
%   \beta\frac{\partial V^{\prime}}{\partial H^{\prime}}
% \end{align}

% From the two first-order conditions \eqref{eq:FOCiRenew} and
% \eqref{eq:FOCjRenew}, I could deduce two functions of $\partial
% V^{\prime}/\partial k^{\prime}$ and $\partial V^{\prime}/\partial
% H^{\prime}$. Substituting them into the right hand side of equation
% \eqref{eq:ETkRenew} and \eqref{eq:ETHRenew} to gain another group of
% functions of $\partial V/\partial k$ and $\partial V/\partial H$. Then
% I change the denotation of functions one period forward and
% substitute them back into \eqref{eq:FOCiRenew} and \eqref{eq:FOCjRenew} 


% \begin{align}
%   \label{eq:ValueFunFossil}
%   V(k,N) &= \max_{i,n}\biggl\lbrace
%   \frac{c ^{1-\gamma}}{1-\gamma }
%   +\beta V(k^{\prime }, S^{\prime },N^{\prime})
%   \biggr\rbrace \\
%   \text{s.t. } k^{\prime} &= i+(1-\delta)k \label{eq:kincFossil}\\
%   N^{\prime } &= N+n   \label{eq:NincFossil}\\
%   S^{\prime } &= S+QAk \label{eq:SincFossil}\\
%   Q^{\prime} &= (1+\pi)Q \label{eq:Qinc}\\
%   Ak &= c+i+n+g(S,N)Ak \label{eq:RConFossil}\\
%   &\text{Given}\; Q_0,\; k_0,\; S_0\; \text{and}\;N_0 \notag
% \end{align}

% From the first order conditions with respect to $i$ and $n$, I have
% \begin{align}
%   \label{eq:FOCiFossil}
%   c^{-\gamma} = \beta\frac{\partial V^{\prime}}{\partial k^{\prime}}\\
%   \label{eq:FOCnFossil}
%   c^{-\gamma} = \beta\frac{\partial V^{\prime}}{\partial N^{\prime}}
%   % \frac{\partial V}{\partial N} = \frac{\partial V}{\partial k}
% \end{align}
% After substituting from \eqref{eq:kincFossil} and
% \eqref{eq:NincFossil} into resource constraint \eqref{eq:RConFossil}
% to eliminate $i$ and $n$, and \eqref{eq:RConFossil} into
% \eqref{eq:ValueFunFossil} to eliminate $c$, I could apply the
% Benveniste-Scheinkman formula to the value function to get
% \begin{align}
%   \label{eq:ETkFossil}
%   \frac{\partial V}{\partial k} &=
%   c^{-\gamma}\big(A-g(S,N)A+1-\delta\big)+
%   \beta\frac{\partial V^{\prime}}{\partial S^{\prime}}QA\\
%   \label{eq:ETNFossil}
%   \frac{\partial V}{\partial N} &=
%   c^{-\gamma}\big(1-Ak\frac{\partial g}{\partial N}\big)\\
%   \label{eq:ETSFossil}
%   \frac{\partial V}{\partial S} &=
%   -c^{-\gamma}Ak\frac{\partial g}{\partial S}+
%   \beta\frac{\partial V^{\prime}}{\partial S^{\prime}}
% \end{align}

% According to \eqref{eq:FOCiFossil} and \eqref{eq:FOCnFossil}, the
% derivatives of $V$ with repect to $k$ and $N$ must be equal. It then
% follows that the left hand sides of equations \eqref{eq:ETkFossil} and
% \eqref{eq:ETNFossil} must be equal, too:
% \begin{align}
%   \label{eq:dvk_dvN_Fossil}
%   A-g(S,N)A-\delta+
%   \beta c^{\gamma}\frac{\partial V^{\prime}}{\partial S^{\prime}}QA =
%   -Ak\frac{\partial g}{\partial N}
% \end{align}

% Then I substitute \eqref{eq:ETkFossil} and \eqref{eq:ETNFossil} into
% \eqref{eq:FOCiFossil} and \eqref{eq:FOCnFossil} respectively to obtain the Euler equations
% \begin{align}
%   \label{eq:EulerkFossil_dvS}
%  \frac{c^{-\gamma}}{\beta c^{\prime -\gamma}} &= \left(
%     A-g(S^{\prime},N^{\prime})A+1-\delta\right)+\frac{\beta}{c^{\prime -\gamma}}
%   \frac{\partial V^{\prime\prime}}{\partial S^{\prime\prime}}Q^{\prime}A \\
%   \label{eq:EulerNFossil}
%  \frac{c^{-\gamma}}{\beta c^{\prime -\gamma}} &=
%   1-Ak^{\prime}\frac{\partial g^{\prime}}{\partial N^{\prime}}
%  \end{align}

% From \eqref{eq:ETSFossil}, I will have:
% \begin{align}
%   \label{eq:dvSprime2Fossil}
% \frac{\partial V^{\prime\prime}}{\partial S^{\prime\prime}} = 
% \frac{1}{\beta}(\frac{\partial V^{\prime}}{ \partial S^{\prime}}+
% c^{-\gamma}Ak\frac{\partial g}{\partial S})
% \end{align}
% where $\partial V^{\prime}/ \partial S^{\prime}$ on the right hand side could be deduced as a function of $S$, $N$ and $k$ from \eqref{eq:dvk_dvN_Fossil}, when $\partial V^{\prime}/ \partial S^{\prime}>0$. So the first Euler equation \eqref{eq:EulerkFossil_dvS} could change to an equation without $\partial V/ \partial S$:\footnote{I abbreviate $g(S,N)$ as $g$ in the following equations}

% \begin{align}
%   \label{eq:EulerkFossil}
%   \frac{c^{-\gamma}}{\beta c^{\prime -\gamma}} = 
% A-g^{\prime}+1-\delta+Q^{\prime}A\left[\frac{1}{Q}
% \left(1-Ak^{\prime}\frac{\partial g^{\prime}}{\partial N^{\prime}}\right)
% \left(g-1+\frac{\delta}{A}-k\frac{\partial g}{\partial N}\right)
% +Ak^{\prime}\frac{\partial g^{\prime}}{\partial S^{\prime}}\right]
% \end{align}

% Substituting \eqref{eq:kincFossil} and \eqref{eq:NincFossil} into
% resource constraint \eqref{eq:RConFossil}, I will have another
% equation I need to solve the model:
% \begin{align}
%   \label{eq:RConFossil0}
%   c+k^{\prime}+N^{\prime}=
%   Ak(1-g)+(1-\delta)k+N
% \end{align}



% In functional equation form:

% \begin{align}
%   \label{eq:ValueFun}
%   v(k,S,N,H) = \max_{k^{\prime },H^{\prime },N^{\prime },S^{\prime}}&\biggl\{
%   \frac{\left[
%       Ak-\left( k^{\prime }-(1-\delta)k\right)
%       -\left( N^{\prime }-(1-\delta )N\right) -j-g(S,N)R-qB
%     \right] ^{1-\gamma }}{1-\gamma } \nonumber \\
%   &+\beta v(k^{\prime },S^{\prime },N^{\prime },H^{\prime })
%   \biggr\} \\
%   \text{s.t. }&Ak = R+B \nonumber \\
%   &g(S,N) \leq 1 \nonumber \\
%   &q =
%   \begin{cases}
%     (\Gamma _{1}+H)^{-\alpha } &
%     \text{if }H\leq \Gamma _{2}{}^{-1/\alpha }-\Gamma _{1}, \nonumber \\
%     \Gamma _{2} &  \text{otherwise}
%   \end{cases}
%   \nonumber \\
%   &H^{\prime } = H+
%   \begin{cases}
%     B^{\psi }j^{1-\psi }  &
%     \text{if }H\leq \Gamma _{2}^{-1/\alpha }-\Gamma_{1}, \nonumber \\
%     0 &  \text{otherwise}
%   \end{cases}
% \end{align}
% In functional equation form:

% \begin{align}
%   \label{eq:ValueFun}
%   v(k,S,N,H) = \max_{k^{\prime },H^{\prime },N^{\prime },S^{\prime}}&\biggl\{
%   \frac{\left[
%       Ak-\left( k^{\prime }-(1-\delta)k\right)
%       -\left( N^{\prime }-(1-\delta )N\right) -j-g(S,N)R-qB
%     \right] ^{1-\gamma }}{1-\gamma } \nonumber \\
%   &+\beta v(k^{\prime },S^{\prime },N^{\prime },H^{\prime })
%   \biggr\} \\
%   \text{s.t. }&Ak = R+B \nonumber \\
%   &g(S,N) \leq 1 \nonumber \\
%   &q =
%   \begin{cases}
%     (\Gamma _{1}+H)^{-\alpha } &
%     \text{if }H\leq \Gamma _{2}{}^{-1/\alpha }-\Gamma _{1}, \nonumber \\
%     \Gamma _{2} &  \text{otherwise}
%   \end{cases}
%   \nonumber \\
%   &H^{\prime } = H+
%   \begin{cases}
%     B^{\psi }j^{1-\psi }  &
%     \text{if }H\leq \Gamma _{2}^{-1/\alpha }-\Gamma_{1}, \nonumber \\
%     0 &  \text{otherwise}
%   \end{cases}
% \end{align}
% Substituting \eqref{eq:Leotiff_ratio} and \eqref{eq:RenewProd1}
%  into the constraint of the household problem, the Lagrangian of
%  household problem is
%  \begin{align}
% \notag
%     \mathcal{L} = &\sum_{t=T_1}^{\infty}\beta^t\frac{c_{t}^{1-\gamma }}{1-\gamma}-
%    \lambda\sum_{t=T_1}^{\infty}p_{t}\bigg[
%      c_{t}+ k_{t+1} - (1-\delta)k_{t}+ \\
% \label{eq:Lag_household}
%      &(H_{t+1}-H_t)^{\frac{1}{1-\psi}}(Ak_t)^{-\frac{\psi}{1-\psi}}-
%      r_tk_t-\left[ p_t^B-m_t(H_t)\right]Ak_t
%    \bigg]
%  \end{align}
%  The first-order condition with respect to consumption $c$ for the
%  household is the same for all $t$ as \eqref{eq:CE_FOCc}. When $H\leq
%  \Gamma _{2}{}^{-1/\alpha}-\Gamma _{1}$, the first-order conditions
%  with respect to $k_{t+1}$ and $H_{t+1}$ are
% \begin{align}
%   \label{eq:CE_FOCkR}
%   &p_t-p_{t+1}(1-\delta)-p_{t+1}r_{t+1}-
% p_{t+1}\frac{\psi A}{1-\psi}(H_{t+2}-H_{t+1})^{\frac{1}{1-\psi}}
% (Ak_{t+1})^{-\frac{1}{1-\psi}} =0\\
% &\frac{p_t}{1-\psi}(Ak_{t})^{-\frac{\psi}{1-\psi}}
% (H_{t+1}-H_{t})^{\frac{\psi}{1-\psi}}-\notag\\
% \label{eq:CE_FOCHR}
% &\frac{p_{t+1}}{1-\psi}(Ak_{t+1})^{-\frac{\psi}{1-\psi}}
% (H_{t+2}-H_{t+1})^{\frac{\psi}{1-\psi}}-
% p_{t+1}\alpha(\Gamma_1+H_{t+1})^{-\alpha-1}Ak_{t+1} = 0
% \end{align}



% A second argument is based on an appropriability market failure if the
% production of the new technology may have spillover benefits from
% learning by doing (LBD) .   The individually optimal
% production level of a firm would take into account the impact on
% future cost reductions for that firm alone. The socially optimal
% production level of tha t firm would take into account the impact on
% future cost reductions for all firms together,

% That is, the productivity gains
% that stem from learning- by-doing may accrue partly to firms other
% than the one that actually undertakes the manufacturing. The alleged
% existence of such knowledge spillovers lies behind the most familiar
% variant of the classic infant-industry argument. When private marginal
% costs of production exceed social marginal costs, because other firms
% benefit from a given firm's output, then an output subsidy is the
% policy instrument of choice. In this context, such subsidies generate
% a pure externality benefit without any offsetting welfare
% negative. Trade policies are next best, as they promote learning
% but also introduce a negative volume-of-trade effect.  
% For each time period $t$, The storage/extraction effect on price shows a positive correlation with long-run trends because a strong demand in the future lowers the incentive for current production of fossil fuel. On the other hand, high future demand increases the optimal investment level and therefore adds to current production in periods when the capacity constraint is binding.
 % constraints of  holds with equality,The Leontief production function implies that to produce one unit
% of $y$, you need a minimum of $1/A$ unit of capital and 1 unit of
% energy, and that adding any more capital or energy will not get you
% any more output. The final good production function exibits constant
% returns to scale, and the logical energy capital ratio $E/k$ to choose
% will be $A$. That is
% \begin{align}
% \label{eq:CE_FOCj}
% &\frac{p_t}{1-\psi}(Ak_{t})^{-\frac{\psi}{1-\psi}}
% (H_{t+1}-H_{t})^{\frac{\psi}{1-\psi}}-\notag\\
% &\frac{p_{t+1}}{1-\psi}(Ak_{t+1})^{-\frac{\psi}{1-\psi}}
% (H_{t+2}-H_{t+1})^{\frac{\psi}{1-\psi}}-
% p_{t+1}s_{t+1} = 0
% \end{align}
